﻿using System;

namespace Model
{
    /// <summary>
    /// Model User
    /// 24/01/2014
    /// @thanhlt
    /// Version 1.0
    /// </summary>
    public class User
    {
        public int Id { get; set; }
        public int IdUserRole { get; set; }
        public string UserName { get; set; }
        public string FullName { get; set; }
        public string Avatar { get; set; }
        public string Password { get; set; }
        public string HashPassword { get; set; }
        public string TheNewPassword { get; set; }
        public string TheLastPassword { get; set; }
        public int Gender { get; set; } // 0:Male, 1:Female
        public DateTime Birthday { get; set; }
        public string School { get; set; }
        public string Working { get; set; }
        public string Company { get; set; }
        public string Language { get; set; }
        public string Sport { get; set; }
        public string Intro { get; set; }
        public int Point { get; set; }
        public DateTime LastDateUpdated { get; set; }
        public string LastUpdatedBy { get; set; }
        public int Status { get; set; }
        public User() { }
        public User(int _Id, int _IdUserRole, string _UserName, string _Avatar, string _Password, string _HashPassword,
                    string _TheNewPassword, string _TheLastPassword, int _Gender, DateTime _Birthday, string _School,
                    string _Working, string _Company, string _Language, string _Sport, string _Intro, DateTime _LastDateUpdated,
                    string _LastUpdatedBy, int _Status)
        {
            Id = _Id;
            IdUserRole = _IdUserRole;
            UserName = _UserName;
            Avatar = _Avatar;
            Password = Common.Encrypt(_Password);
            HashPassword = Common.CalculateMd5Hash(_HashPassword);
            TheNewPassword = _TheNewPassword;
            TheLastPassword = _TheLastPassword;
            Gender = _Gender;
            Birthday = _Birthday;
            School = _School;
            Working = _Working;
            Company = _Company;
            Language = _Language;
            Sport = _Sport;
            Intro = _Intro;
            LastDateUpdated = _LastDateUpdated;
            LastUpdatedBy = _LastUpdatedBy;
            Status = _Status;
        }
    }
}